package BehavioralPatterns.Visitor;

import java.util.LinkedList;
import java.util.List;

public class ObjectStructure {

  private List<Person> person = new LinkedList<Person>();

  public void attach(Person p){
    person.add(p);
  }

  public void detach(Person p){
    person.remove(p);
  }

  public void display(Action action){
    for (Person person1 : person) {
      person1.accpect(action);
    }
  }
}
